<?php if (!defined('THINK_PATH')) exit();?>﻿<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！-->
    <title>学生惠后台管理系统</title>
    <link rel="stylesheet" href="/App/Admin/public/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/App/Admin/public/css/jquery.datetimepicker.css"/>
    <link rel="stylesheet" href="/App/Admin/public/css/style.css"/>
</head>
<body>
<div class="mainBody">
       <div class="mainNav">
        <div class="tit">学生惠后台管理系统</div>
        <div class="navList">
            <ul>
                <li class="active">
                    <a href="<?php echo U("Index/index");?>" class="link"><i class="iconFont left">&#xe602;</i>主页</a>
                </li>
                <li>
                    <a href="<?php echo U("Count/index");?>" class="link"><i class="iconFont left">&#xe750;</i>统计管理</a>
                </li>
                <li>
                    <a href="<?php echo U("Custom/index");?>" class="link"><i class="iconFont left">&#xe650;</i>用户管理</a>
                </li>
                <li>
                    <a href="<?php echo U("shopMange/index");?>" class="link"><i class="iconFont left">&#xe60d;</i>商家管理</a>
                </li>
                <li>
                    <a href="<?php echo U("Order/index");?>" class="link"><i class="iconFont left">&#xe663;</i>订单管理</a>
                </li>
                <li>
                    <a href="<?php echo U("Finance/index");?>" class="link"><i class="iconFont left">&#xe648;</i>财务管理</a>
                </li>
                <li>
                    <a href="<?php echo U("Packet/index");?>" class="link"><i class="iconFont left">&#xe6dc;</i>红包管理</a>
                </li>
                <li>
                    <a href="<?php echo U("Notice/index");?>" class="link"><i class="iconFont left">&#xe601;</i>惠通知</a>
                </li>
                <li>
                    <a href="<?php echo U("Old/index");?>" class="link"><i class="iconFont left">&#xe603;</i>闲置管理</a>
                </li>
                <li>
                    <a href="javascript:;" class="link show"><i class="iconFont left lineHei47">&#xe612;</i>兼职管理<i
                            class="iconFont right">&#xe62e;</i></a>
                    <div class="subNav">
                        <a href="<?php echo U("Job/index");?>">兼职管理</a>
                        <a href="<?php echo U("Jobwant/index");?>">求职管理</a>
                    </div>
                </li>
                <li>
                    <a href="javascript:;" class="link show"><i class="iconFont left lineHei47">&#xe632;</i>系统管理<i
                            class="iconFont right">&#xe62e;</i></a>
                    <div class="subNav">
                        <a href="<?php echo U("Set/index");?>">系统设置</a>
                        <a href="<?php echo U("News/index");?>">公告消息</a>
                        <a href="<?php echo U("Banner/index");?>">BANNER管理</a>
                        <a href="<?php echo U("Rule/index");?>">管理员账号</a>
                        <a href="<?php echo U("Area/index");?>">区域管理</a>
                        <a href="<?php echo U("Feed/index");?>">意见反馈</a>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    
    <div class="main">
          <div class="mainTop">
            <a href="<?php echo U('Login/userlogout');?>" class="text"><i class="iconFont">&#xe66e;</i>退出</a>
            <span class="text"><i class="iconFont">&#xe60b;</i><?php echo ($admin_user_name); ?></span>
        </div>
        <div class="subNav">
            <span class="text"><i class="iconFont">&#xe600;</i>商家管理</span>
        </div>

        <div class="indexBox">
            <div class="con-det">
                <div class="row">
                    <div class="col-md-12">
                       <form action="<?php echo U('shopMange/index');?>" method="post">
                            <table class="formTable">
                                <tbody><tr>
                                    <td class="name noBor">关键字</td>
                                    <td class="noBor">
                                        <input type="text"  name="sh_q"  value="<?php echo ($shArray["sh_q"]); ?>"  class="inp form-control" placeholder="商铺号/商店名">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="name">开店时间</td>
                                    <td>
                                        <input type="text" name="from_time"  value="<?php echo ($shArray['from_time']?$shArray['from_time']:''); ?>"  class="inp time form-control datetimepicker">
                                        <input type="text"  name="to_time"  value="<?php echo ($shArray['to_time']?$shArray['to_time']:''); ?>" class="inp time form-control datetimepicker">
                                    </td>
                                </tr>
                                
                               <!-- ///////////////////////-->
                                      <span class="name">商家类别</span>
					
					
					
                     <div class="col-md-3 col-sm-10 col-xs-3">
                        <select id="select_id1" class="inpTextOne form-control" name="select_name1">
                            <option selected="selected" value="">请选择</option>
							
							  <?php if(is_array($list1) && !empty($list1) ): foreach($list1 as $key=>$item): ?><option  value="<?php echo ($item['id']); ?>"><?php echo ($item['class_name']); ?></option><?php endforeach; else: endif; ?>
					     </select>
                    </div>
					
					
                    <div class="col-md-3 col-sm-10 col-xs-3">
                        <select class="inpTextOne form-control" id="select_id2" name="select_name2">
                           <option selected="selected" value="">请选择</option>
                        </select>
                    </div>
					
					
                    <div class="col-md-3 col-sm-10 col-xs-3">
                    <select class="inpTextOne form-control"  id="select_id3" name="select_name3" >
                           <option selected="selected" value="">请选择</option>
                    </select>
                </div>
				
				
				
                    <div class="col-md-3 col-sm-10 col-xs-3">
                        <select class="inpTextOne form-control"  id="select_id4" name="select_name4">
                           <option selected="selected" value="">请选择</option>
                        </select>
                    </div>
					
				
                               <!--////////////////////////-->
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <tr>
                                    <td class="name">区域</td>
                                    <td>
                                       
                                     
                                         <select  id="select_id5" class="inp address form-control" name="select_name5">
                                            <option selected="selected" value=''>省</option>
                                            <?php if(is_array($listAddress) && !empty($listAddress) ): foreach($listAddress as $key=>$item): ?><option value="<?php echo ($item['id']); ?>" ><?php echo ($item['name']); ?></option><?php endforeach; else: endif; ?>
                                         </select>
                                            
                                            <select id="select_id6"  class="inp address form-control" name="select_name6">
                                                <option selected="selected" value="">市</option>
                                             </select>
                                            
                                           <select  id="select_id7" class="inp address form-control" name="select_name7">
                                                <option selected="selected" value="">大学</option>
                                           </select>
                                            
                                            
                                    </td>
                                </tr>
                                <tr>
                                    <td class="name">商家状态</td>
                                    <td>
                                    
                                         <select class="inp form-control" name="buss_status">
                                            <option selected="selected"  value="">请选择</option>
                                              <?php if(is_array($buss_status_arr) && !empty($buss_status_arr) ): foreach($buss_status_arr as $key=>$item): ?><option value="<?php echo ($key); ?>"  <?php if($key == $shArray['buss_status']): ?>selected<?php endif; ?> ><?php echo ($item); ?></option><?php endforeach; else: endif; ?>
                                         </select>
                                        
                                    </td>
                                </tr>
                                <tr>
                                    <td class="name">商家类别</td>
                                    <td>
                                           <select class="inp form-control" name="shop_type">
                                            <option selected="selected"  value="">请选择</option>
                                              <?php if(is_array($shop_type) && !empty($shop_type) ): foreach($shop_type as $key=>$item): ?><option value="<?php echo ($key); ?>" <?php if($key == $shArray['shop_type']): ?>selected<?php endif; ?> ><?php echo ($item); ?></option><?php endforeach; else: endif; ?>
                                         </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="name"></td>
                                    <td>
                                        <button class="btn btn-primary blue" type="submit">查询</button>
                                    </td>
                                </tr>
                                </tbody></table>
                        </form>
                    </div>
                </div>

                <div class="mt40 listBox">
                    <div class="listScroll">
                        <table class="table table-striped">
                            <tr>
                                <th>商铺号</th>
                                <th>商铺名</th>
                                <th>商家类别</th>
                                <th>店主姓名</th>
                                <th>手机号</th>
                                <th>开店时间</th>
                                <th>身份证号</th>
                                <th>银行卡</th>
                                <th>所在省</th>
                                <th>所在市</th>
                                <th>大学</th>
                                <th>扣点</th>
                                <th>状态</th>
                                <th>商品管理</th>
                                <th>国际品牌</th>
                                <th>操作</th>
                            </tr>
                       <?php if(is_array($list) && !empty($list) ): foreach($list as $key=>$item): ?><tr>
                        <td><?php echo ($item["id"]); ?></td>
                        <td><?php echo ($item["shop_name"]); ?></td>
                        <td><?php echo ($item["class_name"]); ?></td>
                        <td><?php echo ($item["keeper"]); ?></td>
                        <td><?php echo ($item["phone"]); ?></td>
                        <td><?php echo (date('Y-m-d',$item["add_time"])); ?></td>
                        <td><?php echo ($item["idcard"]); ?></td>
                        <td><?php echo ($item["bankcard"]); ?> </td>
                        <td><?php echo ($item["provin"]); ?></td>
                        <td><?php echo ($item["city"]); ?></td>
                        <td><?php echo ($item["school"]); ?></td>
                        <td><?php echo ($item["point"]); ?></td>
			
                        
			 <?php if($item["buss_status"] == 1 ): ?><td>待审核</td>
			 <?php elseif($item["buss_status"] == 2 ): ?>
			 <td>未显示</td>
                          <?php elseif($item["buss_status"] == 3 ): ?>
			 <td>显示中</td>
                          <?php else: ?>
		         <td>禁用</td><?php endif; ?>
			
                         <td><a href="<?php echo U('Product/index','&shop_mid='.$item['mid']);?>" class="btn btn-default btn-xs" >查看</a></td>
                         
                         
                         <?php if($item["shop_type"] == 1): ?><td>
                         <?php if($item["is_set"] == 2 ): ?><a href="<?php echo U('shopMange/is_set','id='.$item['id'].'&is_set='.$item['is_set']);?>" title="取消" onClick="javascript:if(confirm('取消为国际品牌 ？')){return true;}else{return false;}">取消</a>
			 <?php else: ?>
			 <a href="<?php echo U('shopMange/is_set','id='.$item['id'].'&is_set='.$item['is_set']);?>" title="设置" onClick="javascript:if(confirm('确定设置为国际品牌？')){return true;}else{return false;}">设置</a><?php endif; ?>
                         </td>
                         
                         <?php else: ?>
                            <td>  <a href="javascript:void(0);" title="设置" onClick="javascript:if(confirm('只有A类商家可设置为国际品牌')){return true;}else{return false;}">无此功能</a>   </td><?php endif; ?>
                                
                                
                                
                                <td>
                                    <a href="<?php echo U('shopMange/editPoint','&id='.$item['id']);?>" class="btn btn-default btn-xs">详情</a>
                                    <a href="<?php echo U('shopMange/editDetail','&id='.$item['id']);?>" class="btn btn-default btn-xs">编辑</a>
                                    
                                   
                                   <?php if($item["buss_status"] == 1 ): ?><!-- 待审核-->
                                 <a href="javascript:void(0);" title="未审核"  class="btn btn-default btn-xs" onClick="javascript:if(confirm('此店铺尚未审核')){return true;}else{return false;}">启用</a>
			 <?php elseif($item["buss_status"] == 2 ): ?>
			<!-- 未显示-->
                                <a href="javascript:void(0);" title="未显示" class="btn btn-default btn-xs" onClick="javascript:if(confirm('此店铺没有剩余红包')){return true;}else{return false;}">启用</a>
                          <?php elseif($item["buss_status"] == 3 ): ?>
		        <!-- 显示中-->	
                                <a href="<?php echo U('shopMange/busstatus','id='.$item['id'].'&buss_status='.$item['buss_status']);?>" class="btn btn-default btn-xs"  title="禁用" onClick="javascript:if(confirm('确定禁用此店铺？')){return true;}else{return false;}">禁用</a>
                          <?php else: ?>
		         <!-- 禁用-->	
                                <a href="<?php echo U('shopMange/busstatus','id='.$item['id'].'&buss_status='.$item['buss_status']);?>" class="btn btn-default btn-xs"  title="启用" onClick="javascript:if(confirm('确定启用此店铺？')){return true;}else{return false;}">启用</a><?php endif; ?>
                           
                                </td>
                            </tr><?php endforeach; else: endif; ?>
                        </table>
                    </div>
                    <nav aria-label="Page navigation">
                        <ul class="pagination fr">
                            <?php echo ($page); ?>
                        </ul>
                    </nav>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript" src="/App/Admin/public/js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="/App/Admin/public/js/jquery.datetimepicker.js"></script>
<script type="text/javascript" src="/App/Admin/public/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/App/Admin/public/js/time.js"></script>
<script type="text/javascript" src="/App/Admin/public/js/public.js"></script>


<script>
$("#select_id1").change(function(){
var checkValueOne=$("#select_id1").val(); //获取Select选择的Value
/*alert(checkValueOne);die();*/
 $.post('<?php echo U('ShopMange/select_class');?>',{checkValueOne:checkValueOne},function(data){
               $("#select_id2").text(' ');
               $("#select_id2").append(data);
            
        });
});
</script>


<script>
$("#select_id2").change(function(){
var checkValueOne=$("#select_id2").val(); //获取Select选择的Value
/*alert(checkValueOne);die();*/
 $.post('<?php echo U('ShopMange/select_class');?>',{checkValueOne:checkValueOne},function(data){
               $("#select_id3").text(' ');
               $("#select_id3").append(data);
            
        });
});
</script>


<script>
$("#select_id3").change(function(){
var checkValueOne=$("#select_id3").val(); //获取Select选择的Value
/*alert(checkValueOne);die();*/
 $.post('<?php echo U('ShopMange/select_class');?>',{checkValueOne:checkValueOne},function(data){
               $("#select_id4").text(' ');
               $("#select_id4").append(data);
            
        });
});
</script>



<script>
$("#select_id5").change(function(){
var checkValueOne=$("#select_id5").val(); //获取Select选择的Value
/*alert(checkValueOne);die();*/
/*alert(checkValueOne);die();*/
 $.post('<?php echo U('ShopMange/select_address');?>',{checkValueOne:checkValueOne},function(data){
               $("#select_id6").text(' ');
               $("#select_id6").append(data);
            
        });
});
</script>


<script>
$("#select_id6").change(function(){
var checkValueOne=$("#select_id6").val(); //获取Select选择的Value
/*alert(checkValueOne);die();*/
 $.post('<?php echo U('ShopMange/select_address');?>',{checkValueOne:checkValueOne},function(data){
               $("#select_id7").text(' ');
               $("#select_id7").append(data);
            
        });
});
</script>



</body>
</html>